import xyz.migle.base.task.SQLTask

//@file:JvmName("Test")
var mysqlDemo = job {
    author = "migle"
    jobId = "getJ001"
    jobName = "mysql_test"
    jobDescribe = "job describe"
    period = "day"
    batch = "20180901"

    val task001 =  mysql {
        taskName = "create table test2"
        sql = "create table if not exists test_sqldsl_001(id int,name varchar(50))"
    }

   val task02 =  mysql {
        taskName = "create table test1"
        sql = "insert into test_sqldsl_001 values(0,'hello dsl')"
    }

    //前一Task返回下一Task,出错可以继续执行


    task {
        mysql {
            taskName = "create table test2"
            sql = "create table if not exists test_sqldsl_001(id int,name varchar(50))"
        }
    }

    task {
        mysql {
            taskName = "create table test1"
            sql = "insert into test_sqldsl_001 values(0,'hello dsl')"
        }
    }

    onSuccess {
        print("is ok!")
    }
    onFail {
        //我定义通知
        print("is sorrowful!")
    }
}